//
//  Utils.m
//  ABCD
//
//  Created by miaomiao on 14-12-4.
//
//

#import "Utils.h"

@implementation Utils
+ (Utils *)shareUtils
{
    static Utils *utilsInstance = nil;
    static dispatch_once_t predicate;
    dispatch_once(&predicate, ^{
        utilsInstance = [[self alloc] init];
    });
    
    return utilsInstance;
}
+ (NSString *)DocumentPath
{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *doct = [paths objectAtIndex:0];
    
    return doct;

}
+ (NSString *)LibraryPath
{
    NSString *doct = [NSHomeDirectory() stringByAppendingPathComponent:@"Library"];
    
    if (![[NSFileManager defaultManager] fileExistsAtPath:doct])
    {
        [[NSFileManager defaultManager] createDirectoryAtPath:doct withIntermediateDirectories:YES attributes:nil error:nil];
    }
    
    return doct;
}
@end
